package com.alphasta.project.system.ncp.Enum;

import com.alphasta.project.system.ncp.Enum.IExceptionEnum;

/**
 * PRODUCT_NAME: IntelliJ IDEA
 * PROJECT_NAME: ztrace
 * PACKAGE_NAME: com.demo
 * AUTHOR: Choj
 * DATE: 2018-08-13 10:33
 * NAME: ExceptionEnum
 * TODO: 自定义异常
 **/
public enum ExceptionEnum implements IExceptionEnum {
    _200("200", "查询成功"),
    _300("300", "内部错误"),
    _400("400", "网关访问异常"),
    _21001("21001", "请求参数格式有问题"),
    _21002("21002", "请求者标识不存在（rid值错误）"),
    _21003("21003", "目标API接口不存在(sid值错误)"),
    _21004("21004", "请求者没有权限调用此API接口"),
    _21005("21005", "签名错误（sign值错误）"),
    _21006("21006", "签名已过期"),
    _21007("21007", "服务已下线"),
    _21008("21008", "认证信息格式错误"),
    _21009("21009", "权限认证失败"),
    _21010("21010", "HTTPS证书不存在"),
    _21011("21011", "HTTPS证书认证失败"),
    _21012("21012", "获取服务授权密钥（appsecret）太频繁，请稍后再试。"),
    _22001("22001", "并发访问量太高，请稍后再试"),
    _22002("22002", "服务接口禁止在此时间段调用"),
    _22003("22003", "申请的服务调用次数配额已用尽"),
    _23001("23001", "原始接口调用响应超时"),
    _23002("23002", "原始接口调用错误"),
    _23003("23003", "原始服务拒绝连接"),
    _23004("23004", "与原始服务建立连接超时"),
    _23005("23005", "服务已被熔断，稍后再试"),
    _24001("24001", "网关系统内部错误"),
    _24002("24002", "未知错误"),
    _1000("1000", "认证类型错误"),
    _1001("1001", "用户认证失败"),
    _2000("2000", "流控类型错误"),
    _2001("2001", "非法IP"),
    _2002("2002", "访问频度超过上限"),
    _2003("2003", "访问流量超过上限"),
    _2004("2004", "非法关键字"),
    _3000("3000", "安全类型错误"),
    _4000("4000", "加密解密类型错误"),
    _5000("5000", "格式校验错误"),
    _5001("5001", "请求报文校验错误"),
    _9000("9000", "系统异常"),
    _9001("9001", "服务请求超时");

    /**
     * 状态码
     */

    private String code;
    /**
     * 提示信息
     */

    private String message;

    /**
     * 构造函数
     *
     * @param code    状态码
     * @param message 提示信息
     */


    ExceptionEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

    /**
     * 获取状态码
     *
     * @return 状态码
     */

    @Override


    public String getCode() {
        return this.code;
    }


    /**
     * * 获取提示信息
     * *
     * * @return 提示信息
     */
    @Override
    public String getMessage() {
        return this.message;
    }
}
